﻿@{
    Layout = null;
}
@using CNKI.TPI.Web.Search.Model;
<script>
    function searchdb() {
        $($("#ifr")[0].contentWindow.document.body).remove();
        $.ajax({
            type: "GET",
            url: timestamp("@Html.Raw(Url.Action("UserSubmitInfoSearch", "Admin_Report"))"),
            data: { "username": $('#username').val(), "startdate": $('#startdate').val(), "enddate": $('#enddate').val() },
            beforeSend: function () { $("#loading").show(); },
            success: function (msg) {
                if (msg == "True") {
                    //刷新iframe
                    $("#msgtext").html("");
                    $("#ifr").attr("src", "../ReportInfo/ShowReport.aspx?RPTPath=@ViewBag.RPTPath&RPTName=@ViewBag.RPTName").ready();
                }
                else {
                    $("#loading").hide();
                    $("#msgtext").html("该报表暂无数据！");
                }

            },
            error: function (e)
            { $("#loading").hide(); }
        })
    }
    function closeloading()
    {     
        $("#loading").hide();
    }
</script>
<form>
    <div class="wrapR-h" style="margin-top: 20px; padding-bottom: 5px">

        <label class="f-label">用户名称：</label>
        <input type="text" class="f-text span3" id="username" maxlength="255">
        <br />
        <div style="margin-top: 10px">
            <label class="f-label">统计时间：</label>

          @{
                 string startd  = System.DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
                }
            <input type="text" class="f-text span3" id="startdate" readonly="true" value="@startd" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'enddate\')}',dateFmt:'yyyy-MM-dd' })">
            至
              @{
                 string ed  = System.DateTime.Now.ToString("yyyy-MM-dd");
                }
        <input type="text" class="f-text span3" id="enddate" readonly="true" value="@ed" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'startdate\')}',dateFmt:'yyyy-MM-dd' })">
            <input type="button" class="btn btn-m btn-warn-f btn-submit" value="统计" onclick="searchdb();" />

        </div>
        <br />
        <div id="msgtext" style="color:red"></div>
    </div>
    <div>
        <iframe id="ifr" src="../ReportInfo/ShowReport.aspx?RPTPath=@ViewBag.RPTPath&RPTName=@ViewBag.RPTName" width="930" height="800" style="border: 0px;"></iframe>
    </div>
</form>

